<template>
  <div>
    <!-- form表单 -->
    <el-form ref="form" :model="form" label-width="80px" disabled>
      <el-form-item label="企业名称">
        <el-input v-model="form.name" />
      </el-form-item>
      <el-form-item label="公司地址">
        <el-input v-model="form.companyAddress" />
      </el-form-item>
      <el-form-item label="公司电话">
        <el-input v-model="form.companyPhone" />
      </el-form-item>
      <el-form-item label="邮箱">
        <el-input v-model="form.mailbox" />
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="form.remarks" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { getCompanyById } from '@/api/setting'
// map辅助函数
import { mapGetters } from 'vuex'
export default {
  name: 'Comlnfo',
  data() {
    return {
      form: {
        name: '',
        region: ''
      }
    }
  },
  computed: {
    ...mapGetters(['companyId'])
  },
  async created() {
    // 获取公司信息
    const res = await getCompanyById(this.companyId)
    // 将获取公司信息的赋值给form  渲染数据
    this.form = res
  }
}
</script>

<style></style>
